import java.util.Arrays;
import java.util.Scanner;

public class test_4_29 {
    public static void printArray(int[] arr){
        for(int i = 0; i < arr.length; i++){
            System.out.println(arr[i] + " ");
        }
    }
    public static void  transform(int[] arr){
        for(int i = 0; i < arr.length; i++){
            arr[i] *= 2;
        }
    }
    public static int sum(int[] arr){
        int count = 0;
        for (int j : arr) {
            count += j;
        }
        return count;
    }
    public static double avg(int[] arr){
        int count = 0;
        for (int j : arr) {
            count += j;
        }
        return (double)count / arr.length;
    }

    public static void main7(String[] args) {
        int[] num = new int[100];
        Scanner input = new Scanner(System.in);
        System.out.print("您要输入几个数据：");
        int n = input.nextInt();
        System.out.print("请输入您的数据：");
        for (int i = 0; i < n; i++){
            num[i] = input.nextInt();
        }
        for (int i = 0; i < n; i++){
            int a = 0;
            for (int j = i + 1; j < n; j++){
                if (num[i] == num[j]){
                    a = 1;
                    break;
                }
            }
            if (a == 0){
                System.out.print(num[i]);
            }
        }
    }
    public static void main6(String[] args) {
        int[] num = new int[100];
        Scanner input = new Scanner(System.in);
        System.out.print("您要输入几个数据：");
        int n = input.nextInt();
        System.out.print("请输入您的数据：");
        for (int i = 0; i < n; i++){
            num[i] = input.nextInt();
        }
        System.out.print("target = ");
        int y = input.nextInt();
        int a = 0;
        for (int i = 0; i < n; i++){
            for (int j = i + 1; j < n; j++){
                if (num[i] + num[j] == y){
                    System.out.printf("[%d,%d]", num[i], num[j]);
                    a = 1;
                }
            }
        }
        if (a == 0){
            System.out.println("没有符合条件的数据！");
        }
    }
    public static void main(String[] args) {
        int[] arr = new int[100];
        Scanner input = new Scanner(System.in);
        System.out.print("请输入您的数据个数：");
        int n = input.nextInt();
        System.out.print("请输入您的数据：");
        for (int i = 0; i < n; i++){
            arr[i] = input.nextInt();
        }
        int right = n - 1;
        int left = 0;
        while (left < right){
            if (arr[left] % 2 == 1){
                left += 1;
            }else{
                if (arr[right] % 2 == 1){
                    int tem = arr[right];
                    arr[right] = arr[left];
                    arr[left] = tem;
                    left += 1;
                }
                right -= 1;
            }
        }
        for (int i = 0; i < n; i++){
            System.out.print(arr[i] + " ");
        }
    }
    public static void main4(String[] args) {
        int[] arr = {6, 5, 7, 8, 8};
        double ret = avg(arr);
        System.out.println(ret);
    }
    public static void main3(String[] args) {
        int[] arr = {1, 2, 5, 8};
        transform(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void main2(String[] args) {
        int[] arr = {0, 2, 5, 8, 6};
        printArray(arr);
    }
    public static void main1(String[] args) {
        int[] arr = new int[100];
        for(int i = 0; i < 100; i++){
            arr[i] = i + 1;
            System.out.print(arr[i] + " ");
        }
    }
}
